# -*- coding: utf-8 -*-
from django.contrib import admin
from bd42.apps.bdig.models import *


from django.contrib.auth.models import User, Group




### Requisitos ###
## ToDo ##
# adicionar link para exclusão de item no template_list de cada model
# esta faltando os help_text

## Done ##




admin.site.register(Titulacao)




class UsuarioAdmin (admin.ModelAdmin):
    list_display = ('__unicode__', 'titulacao',)
    #list_display_links = ()
    #list_select_related = False
    #list_per_page = 100
    search_fields = ('user__first_name', 'user__last_name',)
    list_filter = ('titulacao',)
    #date_hierarchy = 'dataNascimento'
    #prepopulated_fields = {
    #    'slug' : ('nome',),
    #}
    #save_as = False
    #save_on_top = False
    #ordering = None
    #fields = ()
    #fieldsets = (
    #    (None, {
    #        'fields' : ('nome',),
    #    }),
    #    ('Opções Avançadas', {
    #        'fields' : ('slug',),
    #        'classes' : ('collapse',),
    #    }),
    #)
    #form = forms.ModelForm
    #inlines = [ModelInline,]
    #radio_fields = {'ForeignKeyField': admin.VERTICAL}
    #filter_vertical = ('ManyToManyField',)
    #filter_horizontal = ('ManyToManyField',)
    #class Media:
    #    js = (
    #        "/media/js/script.js",
    #    )
    
    #def queryset(self, request):
        # Filter based on the current user.
    #    return self.model._default_manager.filter(user=request.user)

admin.site.register(Usuario, UsuarioAdmin)




admin.site.register(TipoDePrograma)




class InstituicaoAdmin (admin.ModelAdmin):
    list_display = ('__unicode__', 'site', 'email', 'telefone',)
    #list_display_links = ()
    #list_select_related = False
    #list_per_page = 100
    #search_fields = ('nome',)
    #list_filter = ('nome',)
    #date_hierarchy = 'dataNascimento'
    #prepopulated_fields = {
    #    'slug' : ('nome',),
    #}
    #save_as = False
    #save_on_top = False
    #ordering = None
    #fields = ()
    #fieldsets = (
    #    (None, {
    #        'fields' : ('nome',),
    #    }),
    #    ('Opções Avançadas', {
    #        'fields' : ('slug',),
    #        'classes' : ('collapse',),
    #    }),
    #)
    #form = forms.ModelForm
    #inlines = [ModelInline,]
    #radio_fields = {'ForeignKeyField': admin.VERTICAL}
    #filter_vertical = ('ManyToManyField',)
    #filter_horizontal = ('ManyToManyField',)
    #class Media:
    #    js = (
    #        "/media/js/script.js",
    #    )
    
    #def queryset(self, request):
        # Filter based on the current user.
    #    return self.model._default_manager.filter(user=request.user)

admin.site.register(Instituicao, InstituicaoAdmin)




class CidadeAdmin (admin.ModelAdmin):
    list_display = ('nome', 'uf',)
    #list_display_links = ()
    #list_select_related = False
    #list_per_page = 100
    search_fields = ('nome',)
    list_filter = ('uf',)
    #date_hierarchy = 'dataNascimento'
    #prepopulated_fields = {
    #    'slug' : ('nome',),
    #}
    #save_as = False
    #save_on_top = False
    #ordering = None
    #fields = ()
    #fieldsets = (
    #    (None, {
    #        'fields' : ('nome',),
    #    }),
    #    ('Opções Avançadas', {
    #        'fields' : ('slug',),
    #        'classes' : ('collapse',),
    #    }),
    #)
    #form = forms.ModelForm
    #inlines = [ModelInline,]
    #radio_fields = {'ForeignKeyField': admin.VERTICAL}
    #filter_vertical = ('ManyToManyField',)
    #filter_horizontal = ('ManyToManyField',)
    #class Media:
    #    js = (
    #        "/media/js/script.js",
    #    )
    
    #def queryset(self, request):
        # Filter based on the current user.
    #    return self.model._default_manager.filter(user=request.user)

admin.site.register(Cidade, CidadeAdmin)




class CampusAdmin (admin.ModelAdmin):
    list_display = ('nome', 'instituicao', 'cidade',)
    #list_display_links = ()
    #list_select_related = False
    #list_per_page = 100
    search_fields = ('nome',)
    list_filter = ('instituicao', 'cidade',)
    #date_hierarchy = 'dataNascimento'
    #prepopulated_fields = {
    #    'slug' : ('nome',),
    #}
    #save_as = False
    #save_on_top = False
    #ordering = None
    #fields = ()
    #fieldsets = (
    #    (None, {
    #        'fields' : ('nome',),
    #    }),
    #    ('Opções Avançadas', {
    #        'fields' : ('slug',),
    #        'classes' : ('collapse',),
    #    }),
    #)
    #form = forms.ModelForm
    #inlines = [ModelInline,]
    #radio_fields = {'ForeignKeyField': admin.VERTICAL}
    #filter_vertical = ('ManyToManyField',)
    #filter_horizontal = ('ManyToManyField',)
    #class Media:
    #    js = (
    #        "/media/js/script.js",
    #    )
    
    #def queryset(self, request):
        # Filter based on the current user.
    #    return self.model._default_manager.filter(user=request.user)

admin.site.register(Campus, CampusAdmin)




class ProgramaAdmin (admin.ModelAdmin):
    list_display = ('nome', 'tipo_de_programa', 'campus',)
    #list_display_links = ()
    #list_select_related = False
    #list_per_page = 100
    search_fields = ('nome', 'descricao',)
    list_filter = ('tipo_de_programa', 'campus',)
    #date_hierarchy = 'dataNascimento'
    #prepopulated_fields = {
    #    'slug' : ('nome',),
    #}
    #save_as = False
    #save_on_top = False
    #ordering = None
    #fields = ()
    #fieldsets = (
    #    (None, {
    #        'fields' : ('nome',),
    #    }),
    #    ('Opções Avançadas', {
    #        'fields' : ('slug',),
    #        'classes' : ('collapse',),
    #    }),
    #)
    #form = forms.ModelForm
    #inlines = [ModelInline,]
    #radio_fields = {'ForeignKeyField': admin.VERTICAL}
    #filter_vertical = ('ManyToManyField',)
    #filter_horizontal = ('ManyToManyField',)
    #class Media:
    #    js = (
    #        "/media/js/script.js",
    #    )
    
    #def queryset(self, request):
        # Filter based on the current user.
    #    return self.model._default_manager.filter(user=request.user)

admin.site.register(Programa, ProgramaAdmin)




class TrabalhoAdmin (admin.ModelAdmin):
    list_display = ('titulo', 'autor', 'programa',)
    #list_display_links = ()
    #list_select_related = False
    #list_per_page = 100
    #search_fields = ('nome',)
    list_filter = ('programa', 'workflow')
    #date_hierarchy = 'dataNascimento'
    #prepopulated_fields = {
    #    'slug' : ('nome',),
    #}
    #save_as = False
    #save_on_top = False
    #ordering = None
    #fields = ()
    #fieldsets = (
    #    (None, {
    #        'fields' : ('nome',),
    #    }),
    #    ('Opções Avançadas', {
    #        'fields' : ('slug',),
    #        'classes' : ('collapse',),
    #    }),
    #)
    #form = forms.ModelForm
    #inlines = [ModelInline,]
    #radio_fields = {'ForeignKeyField': admin.VERTICAL}
    #filter_vertical = ('ManyToManyField',)
    #filter_horizontal = ('ManyToManyField',)
    #class Media:
    #    js = (
    #        "/media/js/script.js",
    #    )
    
    #def queryset(self, request):
        # Filter based on the current user.
    #    return self.model._default_manager.filter(user=request.user)

admin.site.register(Trabalho, TrabalhoAdmin)




admin.site.register(CoAutor)




admin.site.register(Correcao)

